package com.cdx.spring.aspect;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * @author chedx
 * @data 2021/1/12 12:55 PM
 */
public class PsndocServiceImpl implements PsndocService , ApplicationContextAware {
    public void login() {
        System.out.println("login");

        PsndocService psndocService = (PsndocService) ctx.getBean("psndocService");
        psndocService.register();
    }

    public void register() {
        System.out.println("register");
    }
    private ApplicationContext ctx;

    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        ctx = applicationContext;
    }
}
